package com.tbit.uqbike.webmanager.business.brandshare.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tbit.uqbike.manager.exception.BaseException;
import com.tbit.uqbike.webmanager.business.brandshare.dao.core.BrandShareRelationDao;
import com.tbit.uqbike.webmanager.business.brandshare.pojo.BrandShareRelation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author: qiu.longjie
 * @create: 2025-05-19
 */
@Slf4j
@Service
public class BrandShareRelationService extends ServiceImpl<BrandShareRelationDao, BrandShareRelation> {

    /**
     * 根据配置ID删除品牌共享关系
     *
     * @param configId 配置ID
     */
    public boolean deleteByConfigId(Integer configId) {
        if (configId == null) {
            throw new BaseException("配置ID不能为空");
        }
        log.info("删除品牌共享关系，配置ID：{}", configId);
        return remove(new QueryWrapper<BrandShareRelation>().eq("configId", configId));
    }
}
